package cn.springcloud.fix.common.core.utils.file;

import lombok.Data;

@Data
public class FileConstant {

    /**
     * 开发模式
     */
    private boolean devMode = false;

    /**
     * 远程上传模式
     */
    private boolean remoteMode = false;

    /**
     * 外网地址
     */
    private String domain = "http://localhost:8888";

    /**
     * 上传下载路径(物理路径)
     */
    private String remotePath = System.getProperty("user.dir") + "/target/blade";

    /**
     * 上传路径(相对路径)
     */
    private String uploadPath = "/upload";

    /**
     * 下载路径
     */
    private String downloadPath = "/download";

    /**
     * 图片压缩
     */
    private boolean compress = false;

    /**
     * 图片压缩比例
     */
    private Double compressScale = 2.00;

    /**
     * 图片缩放选择:true放大;false缩小
     */
    private boolean compressFlag = false;

    /**
     * 项目物理路径
     */
    private String realPath = System.getProperty("user.dir");

    /**
     * 项目相对路径
     */
    private String contextPath = "/";

    private static final FileConstant ME = new FileConstant();

    private FileConstant() {
    }

    public static FileConstant me() {
        return ME;
    }

    public String getUploadRealPath() {
        return (remoteMode ? remotePath : realPath) + uploadPath;
    }

    public String getUploadCtxPath() {
        return contextPath + uploadPath;
    }
}
